Method Community

 

The timing to get screen active recordID (for Bill)

Last post 11-25-2015 7:46 PM by alexhuang. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-24-2015 6:46 PM

    The timing to get screen active recordID (for Bill)

    Hi,

    This issue bugs me for quite a while, and can not figure it out, I'll try to list the issue I met here, and see if you can shed some lights:

    1. I copy default "Bill" and do little customization on it.

    2. In Method's "Bill" screen, before users hit "Select PO" button, the screen actually asks users to save this Bill first to continue. (I guess that is because it asks for RecordID of this Bill.) Then, the screen will save Screen's active RecordID to a shared variable "resultOpenPO_RecordID". And, this works all the time.

    3. In my customization, the only difference is, in my actions, when I did not detect any active RecordID (less than 1), then I will call "Save" button (which does "Save all sections"), then get screen's active RecordID and put it in a shared variable. The issue is, I can not always get screen active RecordID in this way, it sometimes return empty value.

    The question is, is this the right way to generate screen's active RecordID in actions by calling "Save all sections"? Or, should I do it from screen's UI to make it? Thanks.


    Alex

    Chief Architect
    Yi Systems, Inc.
    alexhuang@yisystems.com
    www.yisystems.com blogs.yisystems.com
    Software.Web.Cloud.IT
  • 11-25-2015 10:09 AM In reply to

    Re: The timing to get screen active recordID (for Bill)

    Hi Alex,

    Just so I have everything Correct here,  Essentially What youve changed on the Bill Screen is that on the Select PO... button, youve added a "Save all sections" some where between Sequence 1 and 4


    Is there a reason you needed this functioning in this way? On the stock screen (and by extension, your copied screen) there is a Save all sections action containing on the Vendor Selection dropdown. Meaning the record is saved and a RedordID is generated when you select anything from the Vendor DropDown.

    If you needed the save action functioning within this button however, you could try creating a hidden button on the screen, and have your Select PO... button call this buttons action set for the Save All Sections Action. The delay here would potentially be long enough for the recordID to be saved into your Shared Result variable.


    Thanks Alex, Let me know how you go.

    Regards,

    Ben

    Ben Hargreaves
    Senior Support Specialist
    Method:CRM
    b.hargreaves@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 11-25-2015 12:41 PM In reply to

    Re: The timing to get screen active recordID (for Bill)

    Hi Ben,

    Thanks for all these information. Sorry that I didn't mentioned that I change the action of "Vendor's dropdown", so it does not save Bill when vendor is changed. I also tried your suggestion like:

    1. in "Select PO..." button, I add an action to call default "Save" button as the first action. (Right before condition warning action.)

    2. I tried to test it again, it is a bit better, but still the next "Condition warning" (to check screen's active RecordID) is triggered for no active screen RecordID sometimes

    You mentioned that a "delay" is long enough by calling a button's action, it sounds like active RecordID is not generated along with "Save all sections" immediately?

    I need to alter the origial screen because it creates several empty Bills in our system, and that is caused by a Bill is created, but users don't want to add Bill items or no Bill items are available. So, in our real implementation, we do change default Bill screen and PO_OpenPO screen a lot, so, the Bill is actually created when users select some items and save. However, it does not work as expected, so we go back to do more test on default screen (calling save all sections from action to get active screen RecordID), and see how it goes, and, this is what we have now.


    Thanks again.


    Alex

    Chief Architect
    Yi Systems, Inc.
    alexhuang@yisystems.com
    www.yisystems.com blogs.yisystems.com
    Software.Web.Cloud.IT
  • 11-25-2015 3:38 PM In reply to

    Re: The timing to get screen active recordID (for Bill)

    Answer

    Hi Alex,

    The Save action is very quick, but unfortuantely not instant. The actions being processed have no delay however, which im going to assume is why you are not always getting a value in your Shared Result (ie the subsequent actions are being processed faster than the insert action)

    My thought here was actually if you put all the actions After the Save action on a separate hidden button, and have your "Select PO..." button call this after it saves the record, perhaps the slight delay would be enough to ensure that you will get a recordID to save into your Shared Result. 

    Other than this, my only other suggestion would be to replace your  Save All Sections action with a series of Insert into Table actions to insert the data into the Bill table. The Insert action also allows you to assign the added records RecordID to an action result as part of the action, which would eliminate the need to create the Action Result manually. I wouldnt recommend this option however, as its likely created more resource burden on the screen than is necessary for a process that is relatively simple. If you were to pursue this option, you would also need to make sure you have a Send to Desktop  action to ensure that the record is synced correctly, as this is not done automatically when using the Insert action.

    Thanks Alex, hopefully this helps.

    -Ben

    Ben Hargreaves
    Senior Support Specialist
    Method:CRM
    b.hargreaves@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 11-25-2015 7:46 PM In reply to

    Re: The timing to get screen active recordID (for Bill)

    Hi Ben,

    Thanks for help. I will go for using "insert into table" action to get recordID. 


    Alex

    Chief Architect
    Yi Systems, Inc.
    alexhuang@yisystems.com
    www.yisystems.com blogs.yisystems.com
    Software.Web.Cloud.IT
Page 1 of 1 (5 items)