Trigger Formatted Search on Freight Form
Has anyone gotten a formatted serch to fire on the Sales Order - Freight form based on the document total changing in the main Sales Order form?
Scenario - we set the Freight to a fixed amount $50.00. If the document total goes over $500 then we want to set Freight=$0.00 using a formatted search (i.e. shipping is free when the order is above a certain amount).
In troubleshooting I tried to use SELECT $[$29.0.0] and also tried SELECT $[$-29.0.0] to see if the FMS could even return the Document Total on the freight form but it doesn't seem to be linked.
Anyone gotten this to work?
-Frank
I already tried using
SELECT $[$29.0.Number]
Results in Internal error 3006.
I also tried setting the FMS to SELECT '0.00' with Auto Refresh enabled on When Field Changes = Document Total just to see if the FMS would fire when the main Sales Order total changed. FMS would not fire.
Appears to me that the freight form is in some way disconnected from the main Sales Order form as it relates to FMS.
Anyone gotten this to work outside of going to SDK?
Similar Messages
-
Formatted search on payment form
Hi Experts!
I would like to make a formatted search on payment forms-both outgoing and incoming- which copies the partnername or the accountname according to the doctype into the journal remarks field.
I've created a query but it doesnt work. It runs error.
SELECT case when $[ORCT.doctype]='A' then $[RCT4.Descrip] else
$[ORCT.Cardname] end
Please, can you help whats wrong with this?
Thank you in advance!Try this
SELECT CASE WHEN $[ORCT.DocType] = 'C' THEN $[$32.1]
WHEN $[ORCT.DocType] = 'S' THEN $[$32.1]
ELSE $[$71.2] END
Good luck -
Formatted search in other form
Helo for all,
A have a question. Is possible make a formatted search in a field in the other form?
Ex. I'm on screen of invoice and i want get a value of field the other screen (Purchase Invoice).
Is possible? How To?Hi,
as much as i know formatted searches don't work between different opened forms.
i suggest you to make a small addon for this.
regards
David -
Problem with formatted search on UDO Form
Hi,
I've created an UDO and in the lines I have the fields ItemCode and ItemName. In the ItemName field I have a formatted search configured the next way:
-Search by Saved Query
-QueryName
-Auto refresh when existing altered column
-ItemCode
-Refresh regularly
This formatted search works fine when I do <shift> + F2 in the field. But when I change the field ItemCode and get out of the field it doesn't execute the formatted search.
Any ideas?
Thanks in advance, regards
VanesaHi Vanessa,
Firstly (and I'm not giving lessons on sucking eggs) does this work when run as a query with the $ field replaced with a litteral value that you know exists in the table you're searching (surrounded by single quotes)?
The reason I say this is that I have had a few where as opposed to giving an error I've been hitting shift+f2 with absolutely NO feedback via error messages.
Which form is this within? How have you used the variable element in the query?
Is it possible for you to show the query? Along with details on which form you're using it in?
Hopefully be able to help with more info,
Julian -
My Formatted search work wrong!!
I'd like to get your understanding on my english ability.
But..., Time Pressed..
Please Help me ..
I make a UDO and Formatted search(It Update the U_CardName whenever the U_Cardcode changes )
After, I link a Formatted search to my form(using screen Painter and connecting UDO, it works good).
The problem is formatted search work only When i pushed "Update" button in screen of Define Formatted Search , otherwise it doesn't work.
so now, I work ..
1. Form Load.
2. Ctrl + Shift + f2 press in edittext of U_cardname
3. (Originally, Checked "Display Saved Values"
check "Refresh Regularly" and
check "Display Saved Values"
4. "Update"
what's the my problem?
why is it happend?Hi Lee,
You have to define a Query in the cardname field indicating that the query must be executed when the value of CardCode changes.
Now, define such a query:
SELECT T0.CardName AS 'BP Name' FROM [dbo].[OCRD] T0 WHERE T0.CardCode = RTRIM($[$3.U_CardCode])
Where "3" is the item number of the column that contains the U_CardCode. Check the one is assigned to your field using the "Debug Information" in the "View" Menu
When you define the Formatted Search:
- Select Search by Saved Query and choose the one that contains the statement above
- Auto Refresh when...
- Select here the description that match your U_CardCode field
- Display Saved Values
Now you have set your UFS and it works!
Hope this helps,
Felipe -
Formatted Search and Item Events
Hi,
I am having a huge problem with using Formatted Search and Add-Ons.
On the Sales Order Form I have a Formatted search Setup on the Customer Reference Number, it is set to Auto-Refresh when the CardCode changes. This is the only Formatted search on this form and it works fine.
However, when I run my Add-On, and enter an Item Code it takes about 30 seconds to display the Item Description. In tracing my Add-On it appears to call the Item Event et_GOT_FOCUS on the Item Code Column I just entered over 50 times. I don't use other events, but for testing I did turn on all events and the only other event it occured with was et_LOST_FOCUS.
If I turn off my Add-On or turn off Auto Refresh on the Formatted search everything runs as it should.
I figure the Auto Refresh of the Formatted search has something to do with this, but I need to have this turned on. Another thing is that it only seems to call this event when Before Action = false, It does not seem to be called on Before Action = True.
Can I disable the Formatted search temporarily from within my add-on or is there something else I need to do to keep this from happening.
Thanks for Any Help
PaulHi Alfredo,
Thanks for the suggestion, that sounds like it might be what I am looking for. But I am confused on trying to visualize how this would work. Do I need to duplicate the entire logic that Business One already does or are there some functions in the DI/UI that I can call that does the functions. Since I am doing this from a System(Sales Order) not User Defined Form, does that change anything. I did see the FormattedSearches Object to add a Formatted Search through the DI, but that seems like it will just create the Object and not help me execute it from my Add On.
Is there some code snipits you could provide or get me going in the right direction on how to implement the formatted searches from within my Add-On.
Thanks Again,
Paul -
Formatted search freight variable
I was trying to figure out how to create a SELECT statement that returns true or false depending on if the Freight amount on a sales order form is Zero. If someone could help out
Also, if anyone knows of a source to get more information on all the "$[$4.2.1]" or whatever system variables. So I may better understand them as a whole to use them in user defined queries or what not
Thanks in advanceHi James,
1) Something like:[code]SELECT $[ORDR.TotalExpns] = 0[/code] should do.
2) There's a quite alright doc in the SAP marketplace: "How To Define And Use Formatted Search".
Sincerely,
OC. -
Using Form Variables in a Formatted Search
Hi everyone, I'm relatively new to SAP B1 and just trying to get some info. I have created a few formatted searches, but I am having trouble with this one in particular.
I am trying to get the 'Business Partner Type' Field under Business Partner Master Data (BP Type, [Form=134 Item=40 Pane=0 Variable=1 OCRD,CardType] to change the user defined fields category displayed [Form=-134 Item=9 Pane=0 Variable=62]
For example, when CardType is Vendor ('S' value), I'd like the user defined fields category 'vendor'( '1' value) to show
Here is my query
SELECT CASE
WHEN $[$40.0.1]='S' THEN '0'
ELSE WHEN $[$40.0.1]='C' THEN '1' END
Which is then assigned as a formatted search to that field.
I was trying to find some sort of definitive guide on form variables and formatted search queries; if anyone can point me in the right direction, I'd appreciate it (I have seen the $[$x.y.z] variables but I am not 100% sure on their usage).
Thanks in advanceHi,
Try this:
SELECT CASE $[OCRD.CardType\]
WHEN 'S' THEN '0'
WHEN 'C' THEN '1'
END
Please also response for your previous open thread. You may just close it if you do not like the answer.
Thanks,
Gordon -
Hi Guys,
Thanks very much to John for the answer concerning the formatted Search Form.
But I still have the problem that although the formatted Search has already been defined, the system is always asking if I would to define a new formatted Search,
Has someone already face the same problem ?? and do you know to solve that??
Thanks,
BopDid you define the formatted search by setting up the details in the standard prompt screen, or did you use SQL to update the CSHS table?
If you did it by SQL updates, then it is possible you haven't updated all the fields exactly as required. If for example you leave the ColID field blank because you are not dealing with a matrix it won't work and will prompt you to define a new search. This field requires "-1" in it for the search to work. Mistakes in the other fields can also cause the same behaviour.
If you are doing it via sql, I would suggest that you first set it up through the standard dialog, test it and note all of the field settings. You can then delete it and reproduce them all settings through SQL.
It would be great if CSHS was exposed through the SDK - that would eliminate these types of problems.
John. -
Dear All,
I am trying to do a formatted search on the amount field in the freight screen (Table RDR3) in a sales order (Table ORDR). I have used the below query. Basically i created 2 UDF's (UDF1. a value example 100, UDF2. a discount percentage example 20%) beside the amount field. Now I want the amount field to calculate the below which is to take the 1st UDF value multiplied by the discount percentage to get the discounted value of UDF 1. The rate and currency i need to fetch from the ORDR and i think that's where the problem is.
DECLARE @Amount AS DECIMAL(38,2)
DECLARE @Percent AS DECIMAL(38,2)
DECLARE @Cur AS nvarchar(3)
DECLARE @Rate AS DECIMAL(38,2)
SET @Amount=CAST($[rdr3.u_TransportT] AS DECIMAL(38,2))
SET @Percent=CAST($[rdr3.u_DPerc] AS DECIMAL(38,2))
set @cur = (select T0.DocCur from ORDR T0 where t0.DocEntry = $[rdr3.docentry] )
set @rate = (select T0.DocRate from ORDR T0 where t0.DocEntry = CAST($[rdr3.docentry] AS DECIMAL(38,2)))
Select case when @cur='USD' then (@Amount * ((100 -@Percent) / 100))
when @Cur='EUR' then ((@Amount * @Rate) * ((100 -@Percent) / 100))
else (@Amount / @Rate * ((100 -@Percent) / 100))
end
The result im getting is just a 0 without any errors. Any help on this would be mush appreciated.
If i only need to use one currency i used the below query and it works fine. I get the discounted value in amount field:
DECLARE @Amount AS DECIMAL(38,2)
DECLARE @Percent AS DECIMAL(38,2)
SET @Amount=CAST($[rdr3.u_Amount] AS DECIMAL(38,2))
SET @Percent=CAST($[rdr3.u_percent] AS DECIMAL(38,2))
Select (@Amount * ((100 -@Percent) / 100))
Kindest Regards
JimmyBeni,
Thanks for the reply.
I am not taking the local currency into account in the above query, all of them are foreign currencies.
If i remove the reference to the ORDR table and dont use the CAST or IF statement it works fine. But that would only be useful for 1 currency. -
Formatted search - how to get table or form name
Hello,
I'm trying to create a generic query for modifying "Journal Remark" on different documents (Goods receipt, invoices ...) thru a formatted search
My problem is that I want to customize the "remark" according to the current document.
is there a way to get the table name or the form number in a query ? or should I to create a different query for each document ?
RegardsHi....
If you activate the System Information from Menu Bar> View> System Information. Then when you move the cusrsor from any of the document you get some variable values which displays the ID of forms colums and rows.
You can get this information for your FMS. There is no need to create no. of FMS for each Document. Just take the variables into the FMS and apply to the same ID documents.....
Regards,
Rahul -
How to activate several Formatted Search Forms !!
Hi Guys,
I have a problem concerning the manipulation of formated Search Forms. Actually when using the ActivatMenuItem() method, one needs a UID of the items to be activated. And I would like to use this method to activate several formated Search Forms but I don't know how to get the UID of those formatted Search Forms.
While searching on the Forum, I have seen that some developers used following command SBO_Application.ActivateMenuItem("7425");
I tried that and it works, but it only activates the first formatted Search Form saved in the CSHS table. My problem is how to activate the other formatted Search Forms and how to access their UID.
Thanks in advance for Responding
BopFormatted searches are tied to an individual field on the screen.
They are not launched by individual UID's, there is only one formatted search menu UID - 7425.
The actual screen that is called is based on which field the focus is currently in. If you are in form UID "1", field UID "1" it will call the formatted search (defined in CSHS) for Form 1 / Item 1. If the focus is currently in field UID "2", it will call a different search. If there is no formatted search defined on CSHS for the current field, then it will display a dialog asking if you want to create one.
If you want to open other formatted searches for different fields in your form, simply place the focus on them before calling ActivateMenuItem("7425"). You can do this using the Click method.
John. -
Create Formatted Search by code in a user form
Hi, I want to create a formated search in a user form but it doesnt work using my form id (STEC_EXTRAS) as the search.FormID.
I created the formatted search by SAP (Shift+F2) and in the table of formatted searches the formid appears as 2000001000
¿Where is the relation between my id and the id SAP uses?¿Any SAP table or conversion rule?
Thanks for the possible help.Hello,
When You create a form, the id (Type) can be set up by Add function, ..... it is staring form 2000000000 ...
Maybe Your "ID" STEC_EXTRAS is the Unique ID of the Form...... not the Type
Public Const WM_USERFORM As Integer = 2000000000 ' User defined forms minimum ID
Public Const YOURFORM As Integer= WM_USERFORM + 1 ' My form id will be 2000000001
oForm = m_SBO_Application.Forms.Add("MYFORM", SAPbouiCOM.BoFormTypes.ft_Sizable, YOURFORM - WM_USERFORM)
'this is the same as
oForm = m_SBO_Application.Forms.Add("MYFORM", SAPbouiCOM.BoFormTypes.ft_Sizable, 1)
' or the same as
Dim creationPackage as SAPbouiCOM.FormCreationParams
creationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
creationPackage.UniqueID = "MYFORM"
creationPackage.FormType = YOURFORM
creationPackage.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed
oForm = SBO_Application.Forms.AddEx(creationPackage)
If you use STEC_EXTRAS as FormType, You will see in the CSHS table STEC_EXTRAS as the FormId
Dim creationPackage as SAPbouiCOM.FormCreationParams
creationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
creationPackage.UniqueID = "MYFORM"
creationPackage.FormType = "STEC_EXTRAS"
creationPackage.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed
oForm = SBO_Application.Forms.AddEx(creationPackage)
Regards
J. -
Dynamic SQL an Form values in formatted Search
Hi all,
Can I create Dynamically the where clause of a query (for a Formatted Search) finding that into a UDF of another table, and then store all in a Varchar(300) variable and use that variable as parameter of an EXEC?
Sorry for my bad explanation, it takes less time attach the query ...
so here it is:
declare @pol as varchar(8)
set @pol = $[ORDR.U_PolProj]
declare @internal_q NVARCHAR(300)
select @internal_q = T0.U_CondPol
from [@PRG_CEN_POL_PROJ] T0
where Code = @pol
declare @itcode as varchar(100)
set @itcode = $[RDR1.ItemCode]
declare @sql NVARCHAR(300)
select @sql = 'select result = count(ItemCode)
from OITM T0
where T0.ItemCode = ''' + @itcode +
''' and ' + @internal_q
exec(@sql)
Could someone tell me what's wrong with this formatted search?resolved!!! It works
-
Formatted Search totaling several fields on unsaved form
Hello Experts! I am trying to create a formatted search to total several UDF's, at the row level of a quote, without first having to save the record. HELP. I have tried everything except the correct syntax.
$[38.U_COSTPLUS.1] * $[38.Quantity.1] And I tried
$[QUT1.U_COSTPLUS] * $[QUT1.Quantity] And I tried
$[$149.38.U_COSTPLUS] * $[$149.38.Quantity]
Any suggestions? How can I total several fields for a row, without first having to save the document?
Thanks folks!Presuming that you are trying to use this formatted search on a row level field of a marketing document and U_COSTPLUS is a numeric field.
The syntax would be $[$38.11]*$[$38.U_COSTPLUS]
NOTE: Quantity field is column 11 - you may also spell quantity as $[$38.Quantity]. You were missing the '$' before 38.
Good luck
Suda
Maybe you are looking for
-
How do I get my old Itunes back? I HATE Itunes 11
I liked the old version of Itunes better, I HATE Itunes 11 HOW DO I REVERT TO THE OLD ONE? HELP and not lose my music library
-
Turning Off Backlight Causes Kernel Panic Lenovo y550p Laptop
Recently my Lenovo y550p has started with an issue that seems to be persistent with others using a similar hardware profile with newer 3.1 kernels. When using the function keys, or letting the screen backlight turn off after a certain amount of time
-
I need to change apple stores I'm in Poland on vacation and keep getting the message app not available in Poland change to US store how do I change store?
-
User-exit in va01(real time problem)
Hi Experts, suppose that while creating a sales order i have 4 material in it. now what i want that if the price(kbetr) of any material is below 50 then it should give a error message that 'price for this material is below 50' and that sales order ca
-
Why i cannot buy a apple care online now, any apple 24 hours support can help, due to Hong Kong is Sunday today