Hi all,
I want to create a master form from where we can select multiple account id from the lookup and store in the table.
Please guide me with the steps.
Hi all,
I want to create a master form from where we can select multiple account id from the lookup and store in the table.
Please guide me with the steps.
Hi vikash,
Please put the breakpoint on the appropriate code.
It seems there is some problems on the code:TPZ_TopTenMasters.AccountId = TPZ_TopTenMasters_AccountId.valueStr();
Please change it to TPZ_TopTenMasters.AccountId = this.text();
I still don't see what value you have in the AccountId field in the debugger. Your screenshot only shows the return value of the modified method (true).
And you still have the commented out code in TPZ_TopTenSales_AccountIdUpdate method.
[Form] public class TPZ_TopTenMaster extends FormRun { SysLookupMultiSelectCtrl LookupMultiSelectCtrl; public void init() { super(); // AccountNum- Name of control on which you want a lookup. // CustTableQry- Query to get the lookup data LookupMultiSelectCtrl= SysLookupMultiSelectCtrl::construct(element, TPZ_TopTenMasters_AccountId, querystr(TPZ_TopTenMasterQuery)); } [DataSource] class TPZ_TopTenMasters { ////// /// public void executeQuery() { super(); this.TPZ_TopTenSales_AccountIdUpdate(); } public void TPZ_TopTenSales_AccountIdUpdate() { container mainAccounts; //Set the control value TPZ_TopTenMasters_AccountId.text(TPZ_TopTenMasters.AccountId); //Mark the appropriate checkbox in the drop down mainAccounts = conNull(); mainAccounts = this.createContainer(); if (mainAccounts != conNull()) { // Set controls for existing records LookupMultiSelectCtrl.set(mainAccounts); } //else //{ // LookupMultiSelectCtrl.set(conNull()); //} } ////// /// public container createContainer() { List list = new List(Types::String); ListIterator i; container RecIds, Names; RecId id; list = Global::strSplit(TPZ_TopTenMasters.AccountId,";"); i = new ListIterator(list); while(i.more()) { id = MainAccount::findByMainAccountId(i.value()).RecId; RecIds = id; Names = i.value(); i.next(); } return [RecIds, Names]; } } [Control("String")] class TPZ_TopTenMasters_AccountId { ////// /// /// public boolean modified() { boolean ret; ret = super(); ttsBegin; TPZ_TopTenMasters.AccountId = TPZ_TopTenMasters_AccountId.valueStr(); info(TPZ_TopTenMasters.AccountId); //TPZ_TopTenMasters.update(); ttsCommit; return ret; } } }
Please be more specific. Where do things go wrong in createContainer()? Just telling us that you debugged the method but not what you found isn't very useful.
Your code still has a difference compared to the example in the blog - you have commented out some code in TPZ_TopTenSales_AccountIdUpdate method.
Anyway could you please share us screenshots of following things:
1) The lookup dialog itself when you test it, so that we can see that you have selected values
2) The debugger in the end of modified method of the field, so that we can see if you have some value in the field
And could you also share the latest version of your code? Thanks!
Yes, I have debugged the createContainer method, no values are populating.
I have changed the code and build it, no result.
Did you debug the createContainer method?
One issue that I spotted is that in the modified method you run your logic before the super() call. You should run it after the super() call, just as demonstrated in the blog.
Hi Martin,
I'm not getting any value in info.
I have also opened table browser but the field is blank.
I assume you already debugged it.
Please describe to us what you found out when debugging method "createContainer", and method "modified" of the account id field.
What problem do you have with your code?
I see you commented out update() in modified(), but you have an infolog message there. Are you getting the right value in infolog?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156