Get the selected customers as a filter to record variable

sunctsunct Member Posts: 72
Hi,

I have a particular case where I need to open a customer list form from another form and make selection of some customers and this selection need to return to the first point where I need to use it as a filter for a customer record variable. It works well when I have a few customers to select, but when a huge number of customers need to select, it doesnot work since it throws over flow error for the string variable I am using to return the selection filter to the first function. What could be a work around for this? I tried using an array of string variables, but the problem is that I am not able to use that as a filter in the Setfilter. Appreciate any help on this.

Thanks in Advance
](*,)
Regards,
Sunil

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    I would pass the result set back as a temporary table.
    David Singleton
  • sunctsunct Member Posts: 72
    Hi David,

    Thanks for your reply.

    I didnt get what you mean by that. Could you please explain? How the temporary variable will get filtered recordset in my form?
    Regards,
    Sunil
  • jwilderjwilder Member Posts: 263
    Temporary table is the way to go but you can take a look at Form 22 Customer List. There are 2 Functions there GetSelectionFilter and SetSelectionFilter. GetSelectionFilter will take the selection and put in .. where appropriate instead of all |. Depending on what is being filtered this may avoid your overflow error (or at least reduce it). You call this Function like this maybe from the OnLookup trigger:
    CustomerList.LOOKUPMODE(TRUE);
    IF NOT (CustomerList.RUNMODAL = ACTION::LookupOK) THEN
    EXIT(FALSE)
    ELSE
    Text := CustomerList.GetSelectionFilter;
    EXIT(TRUE);
  • David_SingletonDavid_Singleton Member Posts: 5,479
    sunct wrote:
    Hi David,

    Thanks for your reply.

    I didnt get what you mean by that. Could you please explain? How the temporary variable will get filtered recordset in my form?

    So try it, you can't expect to be just spoon fed.

    Step one is to learn Navision. once you know the App, you will know where to find the ideas.
    David Singleton
  • sunctsunct Member Posts: 72
    thanks David.

    I solved it yesterday itself. thanks for your valued reply.

    Regards
    Regards,
    Sunil
  • sunctsunct Member Posts: 72
    Hi Jason,

    Thanks for your reply. I have tried that solution first, but the problem was that I had around 3000 customers in the list and selecting all (in some particular cases) cross the limit of the variable size. That is when I thought about a way around. But it helped when I use a temperory record vaiable to store all the records from the customer list and then return this variable to my fist function to use it as a filter.

    Once more thanks for your help.

    Regards,
    Suneesh
    Regards,
    Sunil
  • David_SingletonDavid_Singleton Member Posts: 5,479
    sunct wrote:
    Hi Jason,

    Thanks for your reply. I have tried that solution first, but the problem was that I had around 3000 customers in the list and selecting all (in some particular cases) cross the limit of the variable size. That is when I thought about a way around But it helped when I use a temperory record vaiable to store all the records from the customer list and then return this variable to my fist function to use it as a filter.

    Once more thanks for your help.

    Regards,
    Suneesh

    Suneesh,

    I hope you did get a solution. The point is to ask for hints and to get help with specific stumbling blocks or bugs or error messages. The only way you will learn and become better is if you take the hint and try it out and experiment until it works.

    I know its tough, but its the proper way.

    I hope you know the saying 'give a man a fish and you feed him for a day, teach him how to fish and you feed him for life.'
    David Singleton
  • sunctsunct Member Posts: 72
    Hello David,

    Thanks for you reply. Infact, I was in a wrong way of getting a solution using a variable to set the filter. Your reply gave me the idea of using the temperory variable and I realised that it is a simple solution too :) Once I got the idea, it was implemented pretty soon. And, thanks for giving the idea. Hope for your support in future too. Thanks

    Regards
    Regards,
    Sunil
  • David_SingletonDavid_Singleton Member Posts: 5,479
    sunct wrote:
    Hello David,

    Thanks for you reply. Infact, I was in a wrong way of getting a solution using a variable to set the filter. Your reply gave me the idea of using the temperory variable and I realised that it is a simple solution too :) Once I got the idea, it was implemented pretty soon. And, thanks for giving the idea. Hope for your support in future too. Thanks

    Regards

    :thumbsup:
    David Singleton
Sign In or Register to comment.