Need to use the unbound field for the UI in the smart panel
Hi,
I need to add a custom unbound field to my smart panel. So I created a definition for an unbound field ‘selected’ in a DAC extension for POLine like below. This DAC extension is defined in my Graph extension which I use for my custom screen.
public sealed class PoSelected : PXCacheExtension<POLine> { public static bool IsActive() { return true; }
public bool? Selected { get; set; } public abstract class selected : PX.Data.BQL.BqlBool.Field<selected> { } #endregion
}
(I’m not sure whether this definition is right or wrong, If there is something to be added please let me know also)
My purpose of using this field in the smart panel is allow the user to select rows and add to the custom screen like below.
For now I use the selected field which is already in the POLine dac, but using this I realized it causes errors with the data base, So I decided to define an unbound ‘selected’ in a dac extension, But I cannot use it for the UI as expected. below is the code that I tried to add this field to allow user to select rows one by one in the smart panel but it didn’t work, Should I do anything else in the code or in the customization project to add this field to the UI. So can someone help me to solve this issue?
for the reference :
POrdersView = view for getting data from POOrder and POLine
APProformaItemList = DAC for the grid which the selected data should be added in the custom screen
APProformaItems = view for the grid in the custom screen.
Page 1 / 1
Hi @oshadarodrigo64 After selecting the checkbox and click on the ADD&CLOSE button, will those selected records are NOT adding to the main grid?
Hi @Naveen Boga ,
Thanks for the response, now the issue, after selecting the checkbox and clicked on the add button, all the selected and non-selected rows of the smart panel are added to the grid, that is why I said It doesn’t work as I expected. But before modify with this custom ‘selected’ field, I used POLine.selected for the smart panel and it worked properly when adding the values but I faced an error when saving to the database, Here is the link for the community topic which I have already posted on that.
Because of didn’t get a proper solution, I tried to set an unbound field for the POLine, but it also doesn’t work properly.
@oshadarodrigo64 Thanks for providing the details.
After you click on the Add&Close, your code is adding all the line items to the grid, which means accordingly Selected value should be NULL OR TRUE.
Did you debug and verified? what is the value you are getting for the SELECTED unbound field?
Hi @Naveen Boga ,
I debugged and checked then PX.Data.PXDialogRequiredException is thrown. will this be the issue? actually I didn’t get what you asked for value for the unbound field. sorry to say that.
@oshadarodrigo64 As you are using the “Smart Panel”, hence it will give a PXDialogRequried Exception but after you select the checkbox in the popup, then click on Add&Close button, then again it will invoke the code and there you need to check the SELECTED field value.
Thanks for the response and sorry to being late to reply, I’ll check this and let you know whether it’s working or not,
Sure @oshadarodrigo64 if you are still facing any issues, just share me the package, I will check from my end and let you know.
Hi @Naveen Boga
Now I can select and add rows one by one to the grid but unfortunately when saving to the data base again I’m getting the below error.
so how can I share the package with you?
@oshadarodrigo64 You can share it here
@Naveen Boga
could you please check pm that I sent you?
@oshadarodrigo64 Thanks for sharing, but in the customization package there is NO code and DLL included. Hence I could not able to check from my side.
@Naveen Boga ,
oh sorry I didn’t realize that , let me check and upload it
Hi,
small question, if I define a DAC extension for an existing table, should I add all the key fields of that existing table into my DAC extension? or no need of adding them? because for now I have defined the DAC extension with custom filed only .
No @oshadarodrigo64 Not required to add those key fields in the extension table.
Your Custom DAC should have only the custom fields?
Hi @Naveen Boga .
thank you for the response, but the issue of the ‘orderDate’ is still happening, I have shared the dll file with you also. I hope you will be able to go through it.
@oshadarodrigo64 Thanks for sharing. I will check this and let you know